﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using Sharp.DataTransferObject;
using Sharp.Domain.PlatformBoundedContext.MasterDataModule.Aggregates;
using Sharp.Domain.Model;
using Sharp.Infrastructure;
namespace Sharp.ServiceContracts
{
    [ServiceContract]
    public interface ISystemService
    {
        /// <summary>
        /// 保存主数据
        /// </summary>
        /// <param name="masterData">主数据</param>
        /// <returns>操作结果</returns>
        Result SaveMasterData<TMasterData>(TMasterData masterData) where TMasterData : class, IAggregateRoot, IMasterData, new();

        /// <summary>
        /// 删除主数据
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        Result DeleteMasterData<TMasterData>(Guid[] ids) where TMasterData : class, IAggregateRoot, IMasterData, new();
        /// <summary>
        /// 获取一条主数据
        /// </summary>
        /// <returns></returns>
        TMasterData GetMasterDataInfo<TMasterData>(Guid id) where TMasterData : class, IAggregateRoot, IMasterData, new();
        /// <summary>
        /// 获取主数据
        /// </summary>
        /// <returns></returns>
        IList<TMasterData> GetMasterData<TMasterData>() where TMasterData : class, IAggregateRoot, IMasterData, new();

        /// <summary>
        /// 获取省份数据
        /// </summary>
        /// <returns></returns>
        IList<AdministrativeDivision> GetProvinceData();

        /// <summary>
        /// 代码项翻译成文字项
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        string Code2Text<TMasterData>(string code) where TMasterData : class, IAggregateRoot, IMasterData, new();

        /// <summary>
        /// 获取主数据分类
        /// </summary>
        /// <returns></returns>
        IList<MasterData> GetMasterDataSort();
        /// <summary>
        /// 获取分页
        /// </summary>
        /// <param name="pageno"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        PagedResult<MasterDataDTO> GetPaged<TMasterData>(int pageno, int pagesize) where TMasterData : class, IAggregateRoot, IMasterData, new();


    
    }
}
